﻿using System;
using System.ComponentModel;

namespace ExFlash.Records
{
    public class CurvedEdgeRecord : ShapeRecord
    {
        public Boolean StraightFlag
        {
            get;
            protected set;
        }

        [Browsable(false)]
        public Byte NumBits
        {
            get;
            protected set;
        }

        public int ControlDeltaX
        {
            get;
            protected set;
        }

        public int ControlDeltaY
        {
            get;
            protected set;
        }

        public int AnchorDeltaX
        {
            get;
            protected set;
        }

        public int AnchorDeltaY
        {
            get;
            protected set;
        }

        public CurvedEdgeRecord()
            : base(true)
        {

        }

        public override void SwfDeserialize(BinaryBitReader reader)
        {
            StraightFlag = reader.ReadBoolean();

            NumBits = (Byte)reader.ReadUInt32(4);

            ControlDeltaX = reader.ReadInt32(NumBits + 2);

            ControlDeltaY = reader.ReadInt32(NumBits + 2);

            AnchorDeltaX = reader.ReadInt32(NumBits + 2);

            AnchorDeltaY = reader.ReadInt32(NumBits + 2);

            //BitUtil.AdvanceByteOffset(ref offset, BitOffset);
        }

        public override void SwfSerialize(byte[] arr, ref int offset)
        {
            throw new NotImplementedException();
        }
        
    }
}
